import { BaseViewModel, BasePageInfo } from '@ohos/lib_common'
import { API } from '../../../common/constants/api'
import { IForumItem } from '../../common/forumItem/interface'


// 互动信息数据
interface NewsData extends BasePageInfo {
  records: IForumItem[]
}

export interface FetchParams {
  current: number
  lnglat: string
  size: number
}

// 请求数据
export class RecommendNewsModel extends BaseViewModel {
  async getRecommendNews(data: FetchParams) {
    const res = await this.get<NewsData>({ url: API.NEWS, data })
    return res;
  }
}

export const recommendNewsModel = new RecommendNewsModel();